<template>
  <div class="app-menu">
    <div class="hd">
      <!-- <router-link to="/">首页</router-link> -->
      <!-- <router-link to="/yygh?appointType=1">预约挂号</router-link> -->
     <router-link to="/">药品信息</router-link>
     <router-link to="/info">健康常识</router-link>
     <router-link to="/about">关于我们</router-link>
      <!-- <router-link to="/yygh?appointType=3">膏方预约</router-link> -->
       <!-- <router-link to="/report">报告查询</router-link>  -->
      <!-- <router-link to="/cloud">云诊室</router-link> -->
         
       <!-- <a :href="DAOZHEN_URL">智能导诊</a>     -->
      <!-- <router-link to="/classroom">国医讲堂</router-link> -->
    </div>
  </div>
</template>

<script>
import {DAOZHEN_URL} from '../api/api'
export default {
  data () {
    return {
      DAOZHEN_URL: DAOZHEN_URL
    }
  },
  mounted () {
    // 计算男女及年龄
    if (localStorage.person) {
      const person = JSON.parse(localStorage.person)
      const sex = person.sex
      const dob = person.dob
      const year = new Date(dob).getFullYear()
      const mouth = new Date(dob).getMonth()
      const cy = new Date().getFullYear()
      const cm = new Date().getMonth()
      const m = (cy - year) * 12 + (cm - mouth)
      this.DAOZHEN_URL = DAOZHEN_URL + `&gender=${sex}&ageMonth=${m}`
    }
  }
}
</script>

<style lang="less">
.app-menu {
  height: 48px;
  line-height: 48px;
  background:#9E310F url(../assets/app_menu_bg.png) repeat-x;
  a {
    color: #fff;
    font-size: 1.2em;
    display: inline-block;
    width: 131px;
    padding-left: 20px;
    // margin-right: 20p/x;
    &:hover, &.router-link-exact-active{
      background: url(../assets/menu_bg.png) no-repeat center center;
    }
  }
}
</style>
